package com.project.easy.common.framework.web.service.impl.login;

import com.project.easy.common.framework.auth.core.IPassword;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import org.springframework.util.DigestUtils;

/**
 * @author GreatorMan.cool
 * @copyright: Copyright (c) 2020
 * @company: 扬起科技有限公司
 * @date 2021/11/1 21:44
 * @description: 登陆默认密码处理
 */
@Component
@ConditionalOnProperty(prefix = "yqkj.user.login",  name = "code", matchIfMissing = false, havingValue = "md5")
public class Md5Password implements IPassword {

    @Override
    public String encode(String password, String secret) {
        return null;
    }

    @Override
    public String decode(String content, String secret) {
        return null;
    }

    @Override
    public Boolean validata(String content, String password, String secret) {
        return DigestUtils.md5DigestAsHex(password.getBytes()).equals(content);
    }
}
